
cmake_minimum_required(VERSION 3.4.1)

# 添加头文件路径
include_directories(./src/main/head)

# 添加C\C++文件路径
SET(DIR_SRC ./src/main/cpp)

FOREACH(next_ITEM ${DIR_SRC})
  aux_source_directory (${next_ITEM} SRC_INCLUDE)
  list(APPEND ALL_SRC ${SRC_INCLUDE})      #TODO
ENDFOREACH(next_ITEM ${DIR_SRC})

# 添加NDK的库文件
find_library( log-lib
              log )

#导入第三方依赖库
add_library(
    libiconv
    SHARED
    IMPORTED
)
#设置第三方依赖库的目录地址
set_target_properties(
    libiconv
    PROPERTIES IMPORTED_LOCATION
    ${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libiconv.a
)

# 生成动态库文件
add_library( tools_v2.1
             SHARED
             ${ALL_SRC} )

target_link_libraries( tools_v2.1 libiconv  ${log-lib} )



# 生成静态库文件
 add_library(tools_v2.1_static
              STATIC
              ${ALL_SRC})

 target_link_libraries(  tools_v2.1_static libiconv  ${log-lib} )